<?php

namespace app\course\validate;


use think\Validate;

class CourseValidate extends Validate
{
    protected $rule = [
        'category_id' => 'require',
        'course_name' => 'require',
        'unit_price' => 'require|gt:0',
        'course_hour' =>  'require|gt:0',
        'total_price' =>  'require|gt:0',


    ];
    protected $message = [
        'category_id.require' => '课程没类没有选',
        'course_name.require' => '课程名字不能为空',
        'unit_price.require' => '课程单价不能为空',
        'course_hour.require' => '课时不能为空',
        'total_price.require' => '课程总价不能为空',

        'unit_price.gt' => '课程单价不能为负值',
        'course_hour.gt' => '课时不能为负值',
        'total_price.gt' => '课程总价不能负值',
    ];

}